﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class LoadingRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlBolID;
        protected DropDownList ddlCarrierID;
        protected DropDownList ddlExternOrderID2;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlPaid;
        protected DropDownList ddlStatusOper;
        protected HtmlForm F15720;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected Label lblBeginDate;
        protected Label lblBolID;
        protected Label lblCarrierID;
        protected Label lblEndDate;
        protected Label lblExternOrderID2;
        protected Label lblOwnerID;
        protected Label lblPaid;
        protected Label lblStatus;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtBeginDate;
        protected TextBox txtBolID;
        protected TextBox txtCarrierID;
        protected TextBox txtEndDate;
        protected TextBox txtExternOrderID2;
        protected TextBox txtOwnerID;
        protected TextBox txtPaid;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("LoadingRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlBolID, 0);
            base.InitQueryDDL(this.ddlExternOrderID2, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlCarrierID, 0);
            base.InitQueryDDL(this.ddlPaid, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.BindData2DDLBySysCode(this.MSCStatus, "BOLStatus");
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string BeginDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBeginDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtBeginDate.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "";
            }
        }

        public string BolID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtBolID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtBolID.Text.Trim(), this.ddlBolID.SelectedValue);
                }
                return "";
            }
        }

        public string CarrierID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtCarrierID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtCarrierID.Text.Trim(), this.ddlCarrierID.SelectedValue);
                }
                return "";
            }
        }

        public string EndDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndDate.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "";
            }
        }

        public string ExternOrderID2
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternOrderID2.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternOrderID2.Text.Trim(), this.ddlExternOrderID2.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string Paid
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPaid.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPaid.Text.Trim(), this.ddlPaid.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

